package com.baizhi.demo;

public class Demo {
    public static void main(String[] args) {

        //接口的匿名内部类
        Pet p = new Pet() {  // 方法匿名内部类

//            public Pet(){}

            @Override
            public void sleep() {

            }
        };


        //抽象类的匿名内部类
        Person pp = new Person() {

          // public Person(){}

            @Override
            void eat() {

            }
        };
    }
}
